<template>
  <div>
    <mt-cell title="签字"></mt-cell>
    <sigh-piecture :showColor="false" @onComplete="getLessImage"></sigh-piecture>
    <mt-cell title="承租方" label="预览签名">
      <img :src="formData.signTenantry"/>
    </mt-cell>
    <a-input :value="$route.query.id"   v-model="formData.pkManagement" type="hidden"> </a-input>
    <mt-field label="签署日期" type="date" v-model="formData.signDate"></mt-field>
    <mt-button
      size="large"
      type="primary"
      style="margin-bottom: 10px"
      @click="sighsubmit"
    >提交
    </mt-button>

    <mt-button
      size="large"
      style="margin-bottom: 10px"
      @click="comeBack"
    >返回
    </mt-button>

  </div>
</template>

<script>
    import * as mint from 'mint-ui';
    import SighPiecture from '../../../components/SighPicture/SighPiecture'
    import {deleteAction, getAction, downFile, postAction} from '@/api/manage'
    export default {
        name: "sighTable",
        components: {
            SighPiecture
        },
        data() {
            return {
                formData: {signTenantry:'',pkManagement:this.$route.query.id,signDate:''},
            }
        },
        methods: {
            comeBack() {
                this.$router.push('/phone/contractManagement/list');
            },
            getLessImage(val) {
                console.log(val);
                this.formData.signTenantry = val;
            },
            sighsubmit(){
                postAction('/phone/contractManagement/contract/edit',this.formData).then((res)=>{
                    if (res.success) {
                        this.comeBack();
                    }
                })
            }
        }
    }
</script>

<style >
  .ant-layout-header {
    display: none;
  }
</style>